@extends('admin.layout')
@section('content');
	<!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                电影管理
                <small>列表</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i>后台</a></li>
                <li><a href="#">电影管理</a></li>
                <li class="active">列表</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title">快速查看电影列表</h3>
                        </div><!-- /.box-header -->
                        <div class="box-body">
                            <table id="example2" class="table table-bordered table-hover">
                            @if(session('info'))
                            <div id="showHidden" class="alert alert-success alert-dismissable">
								<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
								<li>{{ session('info') }}</li>
							</div>
							@endif
							<div class="row">
								<form accept="{{ url('/admin/post/index') }}" method="get">
									<div class="col-md-4">
										<div class="form-group">
		                                    <select name="num" class="form-control">
		                                        <option value="10" 
		                                        	@if(!empty($request['num']) && $request['num'] == 10)
														selected="selected" 
		                                        	@endif
		                                        	>10</option>
		                                        <option value="15" 
		                                        	@if(!empty($request['num']) && $request['num'] == 15)
														selected='selected' 
		                                        	@endif
		                                        	>15</option>
		                                        <option value="50" 
		                                        	@if(!empty($request['num']) && $request['num'] == 50)
														selected='selected' 
		                                        	@endif
		                                        	>50</option>
		                                        <option value="100" 
		                                        	@if(!empty($request['num']) && $request['num'] == 100)
														selected='selected' 
		                                        	@endif
		                                        	>100</option>
		                                    </select>
		                                </div>
		                            </div>
									<div class="col-md-6 col-md-offset-2">
										<div class="input-group input-group">
	                                		<input class="form-control" type="text" name="keyword" value="{{ $request['keyword'] or '' }}">
	                    					<span class="input-group-btn">
	                      					<button class="btn btn-info btn-flat" type="submit">搜索</button>
	                    					</span>
	                            		</div>
									</div>
								</form>
							</div>
							<div class="row" style="height:10px;">
							</div>
                                <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>宣传海报</th>
                                    <th>电影名称</th>
                                    <th>类型</th>
                                    <th>地区</th>
                                    <th>年代</th>
                                    <th>制作阵容</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($data as $v)
                                <tr>
                                    <td>{{ $v -> id }}</td>
                                    <td><img src="{{ asset($v -> photo) }}" width="50px"></td>
                                    <td><a href="{{ url('/admin/post/index') }}/{{ $v -> id }}">{{ $v -> name }}</a></td>
                                    <td>{{ $v -> pid }}</td>
                                    <td>{{ $v -> path }}</td>
                                    <td>{{ $v -> time }}</td>
                                    <td>{{ $v -> cast }}</td>
                                    <td>
                                        <a href="{{ url('/admin/cate/post') }}/{{ $v -> id }}">发表影评</a> | 
                                        <a href="{{ url('/admin/cate/edit') }}/{{ $v -> id }}">编辑</a> | 
                                        <a href="{{ url('/admin/cate/delete') }}/{{ $v -> id }}">删除</a>
                                    </td>
                                </tr>
                                @endforeach
                                </tbody>
                            </table>
                            {!! $data -> appends($request) ->render() !!}
                        </div><!-- /.box-body -->
                    </div><!-- /.box -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->
@endsection
<!-- page script -->
<script>

</script>